const Login = () => import('@/views/login/index.vue')
const Layout = () => import('@/layout/index.vue')
const NotFound = () => import('@/views/404/index.vue')


const Home = () => import('@/views/home/index.vue')
const Screen = () => import('@/views/screen/index.vue')
// 权限管理
const User = () => import('@/views/acl/user/index.vue')
const Role = () => import('@/views/acl/role/index.vue')
const Permission = () => import('@/views/acl/permission/index.vue')
// 商品管理
const Attr = () => import('@/views/product/attr/index.vue')
const SPU = () => import('@/views/product/spu/index.vue')
const SKU = () => import('@/views/product/sku/index.vue')
const Trademark = () => import('@/views/product/trademark/index.vue')

// 配置常规路由
export const routes = [
  {
    path: '/login',
    component: Login,
    name: 'Login',
    meta: {
      title: '登录',
      hidden: true,
      icon: 'Plus',
    },
  },
  {
    path: '/',
    component: Layout,
    name: 'Layout',
    meta: {
      title: '',
      hidden: false,
      icon: '',
    },
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: Home,
        name: 'Home',
        meta: {
          title: '首页',
          hidden: false,
          icon: 'HomeFilled',
        },
      },
    ],
  },
  {
    path: '/screen',
    component: Screen,
    name: 'Screen',
    meta: {
      title: '数据大屏',
      hidden: false,
      icon: 'Plus',
    },
  },
  {
    path: '/404',
    component: NotFound,
    meta: {
      title: '404',
      hidden: true,
      icon: 'Plus',
    },
  },
]
// 异步路由
export const asyncRoutes = [
  {
    path: '/acl',
    component: Layout,
    name: 'Acl',
    meta: {
      title: '权限管理',
      hidden: false,
      icon: 'Plus',
    },
    children: [
      {
        path: '/acl/user',
        component: User,
        name: 'User',
        meta: {
          title: '用户管理',
          hidden: false,
          icon: 'Edit',
        },
      },
      {
        path: '/acl/role',
        component: Role,
        name: 'Role',
        meta: {
          title: '角色管理',
          hidden: false,
          icon: 'Edit',
        },
      },
      {
        path: '/acl/permission',
        component: Permission,
        name: 'Permission',
        meta: {
          title: '菜单管理',
          hidden: false,
          icon: 'Edit',
        },
      },
    ],
  },
  {
    path: '/product',
    component: Layout,
    name: 'Product',
    meta: {
      title: '商品管理',
      hidden: false,
      icon: 'Goods',
    },
    children: [
      {
        path: '/product/trademark',
        component: Trademark,
        name: 'Trademark',
        meta: {
          title: '品牌管理',
          icon: 'Goods',
        },
      },
      {
        path: '/product/attr',
        component: Attr,
        name: 'Attr',
        meta: {
          title: '属性管理',
          icon: 'Goods',
        },
      },
      {
        path: '/product/spu',
        component: SPU,
        name: 'Spu',
        meta: {
          title: 'SPU管理',
          icon: 'Goods',
        },
      },
      {
        path: '/product/sku',
        component: SKU,
        name: 'Sku',
        meta: {
          title: 'SKU管理',
          icon: 'Goods',
        },
      }
    ],
  },
]
// 任意路由
export const anyRoutes = [
  {
    path: '/:pathMatch(.*)*',
    redirect: '/404',
    name: 'Any',
    meta: {
      title: '任意路由',
      hidden: true,
      icon: 'Plus',
    },
  }
]